import time
s = open("m2_reverse.txt")
a = [int(x) for x in s]
n = len(a)
t0 = time.time()
for j in range(n-1):
    f = 0
    for i in range(n-j-1):
        if a[i]>a[i+1]:
            a[i],a[i+1] = a[i+1],a[i]
            f = 1
    if f == 0:
             break
t2 = time.time()
print('m2_reverse', round((t2-t0)*1000),'milliseconds')

